<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>TURN Server: turn::StunMsgResponse Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">TURN Server
   &#160;<span id="projectnumber">1.5</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.8.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespaceturn.html">turn</a>      </li>
      <li class="navelem"><a class="el" href="classturn_1_1StunMsgResponse.html">StunMsgResponse</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">turn::StunMsgResponse Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for turn::StunMsgResponse:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classturn_1_1StunMsgResponse.png" usemap="#turn::StunMsgResponse_map" alt=""/>
  <map id="turn::StunMsgResponse_map" name="turn::StunMsgResponse_map">
<area href="classturn_1_1StunMsg.html" alt="turn::StunMsg" shape="rect" coords="0,0,144,24"/>
</map>
 </div></div>

<p><a href="classturn_1_1StunMsgResponse-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a2711bd129549ec120158edb3adc78b6e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgResponse.html#a2711bd129549ec120158edb3adc78b6e">StunMsgResponse</a> (u16bits method, <a class="el" href="structstun__tid.html">stun_tid</a> &amp;tid)</td></tr>
<tr class="memitem:a27286d74060e1d798dc443830198ecc7"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgResponse.html#a27286d74060e1d798dc443830198ecc7">StunMsgResponse</a> (u16bits method, int error_code, std::string reason, <a class="el" href="structstun__tid.html">stun_tid</a> &amp;tid)</td></tr>
<tr class="memitem:a08d38d9a7ea603c98a729ae55b34a1a5"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgResponse.html#a08d38d9a7ea603c98a729ae55b34a1a5">StunMsgResponse</a> (u08bits *buffer, size_t total_sz, size_t sz, bool constructed)  throw (WrongStunBufferFormatException)</td></tr>
<tr class="memitem:ace411fb3e6be8571289b7bfa65289469"><td class="memItemLeft" align="right" valign="top">u16bits&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgResponse.html#ace411fb3e6be8571289b7bfa65289469">getMethod</a> () const </td></tr>
<tr class="memitem:a3402756dc96c4c762d9ee4a2354d2c37"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgResponse.html#a3402756dc96c4c762d9ee4a2354d2c37">setMethod</a> (u16bits method)</td></tr>
<tr class="memitem:a015b48d56d20d26577fcc8327a24b8fb"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgResponse.html#a015b48d56d20d26577fcc8327a24b8fb">getError</a> () const </td></tr>
<tr class="memitem:a50b8e415e84f0902c853fb3b0e816229"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgResponse.html#a50b8e415e84f0902c853fb3b0e816229">setError</a> (int err)</td></tr>
<tr class="memitem:ad6f25135216cbb232351063a41e0169a"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgResponse.html#ad6f25135216cbb232351063a41e0169a">getReason</a> () const </td></tr>
<tr class="memitem:a1df5a68abae6cd68c05e1b71d47f7e39"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgResponse.html#a1df5a68abae6cd68c05e1b71d47f7e39">setReason</a> (std::string reason)</td></tr>
<tr class="memitem:abe1a0fb7b3753d0ced2a47f5052969c6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgResponse.html#abe1a0fb7b3753d0ced2a47f5052969c6">setTid</a> (<a class="el" href="structstun__tid.html">stun_tid</a> &amp;tid)  throw (WrongStunBufferFormatException)</td></tr>
<tr class="memitem:aa7510a0d7f94b89d479fa128bf5bb66a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structstun__tid.html">stun_tid</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgResponse.html#aa7510a0d7f94b89d479fa128bf5bb66a">getTid</a> ()  throw (WrongStunBufferFormatException)</td></tr>
<tr class="memitem:aa13107eff5faec24cb4415f83c4183d9"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgResponse.html#aa13107eff5faec24cb4415f83c4183d9">isChallenge</a> (std::string &amp;realm, std::string &amp;nonce) const </td></tr>
<tr class="memitem:afb1272d9a7ef47752506fcdd53033843"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgResponse.html#afb1272d9a7ef47752506fcdd53033843">isChallenge</a> () const </td></tr>
<tr class="memitem:a08663fcaf87fa75784f1be1f6c15b5f6"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgResponse.html#a08663fcaf87fa75784f1be1f6c15b5f6">isSuccess</a> () const </td></tr>
<tr class="memitem:a43503b954af564da59f9777c7527bb33"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgResponse.html#a43503b954af564da59f9777c7527bb33">constructBindingResponse</a> (<a class="el" href="structstun__tid.html">stun_tid</a> &amp;tid, const ioa_addr &amp;reflexive_addr, int error_code, const u08bits *reason)</td></tr>
<tr class="memitem:afce6f0043e1bdfca9ebe1c8b9114486e"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgResponse.html#afce6f0043e1bdfca9ebe1c8b9114486e">isBindingResponse</a> () const </td></tr>
<tr class="memitem:aaf5ffcd9cdff8108c22f920c970cd534"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgResponse.html#aaf5ffcd9cdff8108c22f920c970cd534">constructAllocateResponse</a> (<a class="el" href="structstun__tid.html">stun_tid</a> &amp;tid, const ioa_addr &amp;relayed_addr, const ioa_addr &amp;reflexive_addr, u32bits lifetime, int error_code, const u08bits *reason, u64bits reservation_token)</td></tr>
<tr class="memitem:ae64da83f5eec8c6b762710decbf21211"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgResponse.html#ae64da83f5eec8c6b762710decbf21211">constructChannelBindResponse</a> (<a class="el" href="structstun__tid.html">stun_tid</a> &amp;tid, int error_code, const u08bits *reason)</td></tr>
<tr><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:ad75a2b4892d6ddae86da0fb4d0aebbba"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgResponse.html#ad75a2b4892d6ddae86da0fb4d0aebbba">constructBuffer</a> ()</td></tr>
<tr class="memitem:a64b9f523cdd3558837bc15e193ce336a"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgResponse.html#a64b9f523cdd3558837bc15e193ce336a">check</a> ()</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Class for STUN/TURN responses </p>

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l00854">854</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a2711bd129549ec120158edb3adc78b6e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classturn_1_1StunMsgResponse.html#a2711bd129549ec120158edb3adc78b6e">turn::StunMsgResponse::StunMsgResponse</a> </td>
          <td>(</td>
          <td class="paramtype">u16bits&#160;</td>
          <td class="paramname"><em>method</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structstun__tid.html">stun_tid</a> &amp;&#160;</td>
          <td class="paramname"><em>tid</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l00856">856</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">: _method(method), _err(0), _reason(<span class="stringliteral">&quot;&quot;</span>), _tid(tid) {};
</pre></div>
</div>
</div>
<a class="anchor" id="a27286d74060e1d798dc443830198ecc7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classturn_1_1StunMsgResponse.html#a2711bd129549ec120158edb3adc78b6e">turn::StunMsgResponse::StunMsgResponse</a> </td>
          <td>(</td>
          <td class="paramtype">u16bits&#160;</td>
          <td class="paramname"><em>method</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>error_code</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::string&#160;</td>
          <td class="paramname"><em>reason</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structstun__tid.html">stun_tid</a> &amp;&#160;</td>
          <td class="paramname"><em>tid</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l00857">857</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">                                                                                         :
                _method(method), _err(error_code), _reason(reason), _tid(tid) {

        };
</pre></div>
</div>
</div>
<a class="anchor" id="a08d38d9a7ea603c98a729ae55b34a1a5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classturn_1_1StunMsgResponse.html#a2711bd129549ec120158edb3adc78b6e">turn::StunMsgResponse::StunMsgResponse</a> </td>
          <td>(</td>
          <td class="paramtype">u08bits *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>total_sz</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>sz</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>constructed</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>  throw (<a class="el" href="classturn_1_1WrongStunBufferFormatException.html">WrongStunBufferFormatException</a>)<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l00861">861</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">                                                      :
                        <a class="code" href="classturn_1_1StunMsg.html#a96595cee419124a84d6bfa73407da683">StunMsg</a>(buffer,total_sz,sz,constructed),_method(0),_err(0),_reason(<span class="stringliteral">&quot;&quot;</span>) {

                <span class="keywordflow">if</span>(constructed) {
                        <span class="keywordflow">if</span>(!<a class="code" href="ns__turn__msg_8h.html#a94312a39c2c9f79b8f89bc3b70105186">stun_is_success_response_str</a>(buffer,sz)) {
                                u08bits errtxt[0xFFFF];
                                <span class="keywordflow">if</span>(!<a class="code" href="ns__turn__msg_8h.html#ac73cfbf0bdd56b17d57927aefa7673d8">stun_is_error_response_str</a>(buffer,sz,&amp;_err,errtxt,<span class="keyword">sizeof</span>(errtxt))) {
                                        <span class="keywordflow">throw</span> WrongStunBufferFormatException();
                                }
                                _reason = (<span class="keywordtype">char</span>*)errtxt;
                        }
                        _method = <a class="code" href="ns__turn__msg_8h.html#ad36b53fe3bd0eff2cd84ac9e27ba868e">stun_get_method_str</a>(buffer,sz);
                        <a class="code" href="ns__turn__msg_8h.html#a49eaa17067381e5a8bb87032689c9215">stun_tid_from_message_str</a>(<a class="code" href="classturn_1_1StunMsg.html#a0222f924d9fc1b9b268ba87c459dd7fd">_buffer</a>,<a class="code" href="classturn_1_1StunMsg.html#aa3c270c8abbdd22abe101907248754a9">_sz</a>,&amp;_tid);
                }
        }
</pre></div>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a64b9f523cdd3558837bc15e193ce336a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool <a class="el" href="classturn_1_1StunMsgResponse.html#a64b9f523cdd3558837bc15e193ce336a">turn::StunMsgResponse::check</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline, protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Implements <a class="el" href="classturn_1_1StunMsg.html#a9c6452d0d71052a0bda4ded876cc43ea">turn::StunMsg</a>.</p>

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l01009">1009</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">                             {
                <span class="keywordflow">if</span>(!<a class="code" href="classturn_1_1StunMsg.html#ac00be2fea5b4ab929ea6078871ec33d8">_constructed</a>)
                        <span class="keywordflow">return</span> <span class="keyword">false</span>;
                <span class="keywordflow">if</span>(!<a class="code" href="ns__turn__msg_8h.html#a94312a39c2c9f79b8f89bc3b70105186">stun_is_success_response_str</a>(<a class="code" href="classturn_1_1StunMsg.html#a0222f924d9fc1b9b268ba87c459dd7fd">_buffer</a>,<a class="code" href="classturn_1_1StunMsg.html#aa3c270c8abbdd22abe101907248754a9">_sz</a>)) {
                        u08bits errtxt[0xFFFF];
                        <span class="keywordtype">int</span> cerr=0;
                        <span class="keywordflow">if</span>(!<a class="code" href="ns__turn__msg_8h.html#ac73cfbf0bdd56b17d57927aefa7673d8">stun_is_error_response_str</a>(<a class="code" href="classturn_1_1StunMsg.html#a0222f924d9fc1b9b268ba87c459dd7fd">_buffer</a>,<a class="code" href="classturn_1_1StunMsg.html#aa3c270c8abbdd22abe101907248754a9">_sz</a>,&amp;cerr,errtxt,<span class="keyword">sizeof</span>(errtxt))) {
                                <span class="keywordflow">throw</span> WrongStunBufferFormatException();
                        }
                        <span class="keywordflow">if</span>(cerr != _err) {
                                <span class="keywordflow">throw</span> WrongStunBufferFormatException();
                        }
                }
                <span class="keywordflow">if</span>(_method != <a class="code" href="ns__turn__msg_8h.html#ad36b53fe3bd0eff2cd84ac9e27ba868e">stun_get_method_str</a>(<a class="code" href="classturn_1_1StunMsg.html#a0222f924d9fc1b9b268ba87c459dd7fd">_buffer</a>,<a class="code" href="classturn_1_1StunMsg.html#aa3c270c8abbdd22abe101907248754a9">_sz</a>)) {
                        <span class="keywordflow">return</span> <span class="keyword">false</span>;
                }
                <span class="keywordflow">return</span> <span class="keyword">true</span>;
        }
</pre></div>
</div>
</div>
<a class="anchor" id="aaf5ffcd9cdff8108c22f920c970cd534"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classturn_1_1StunMsgResponse.html#aaf5ffcd9cdff8108c22f920c970cd534">turn::StunMsgResponse::constructAllocateResponse</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structstun__tid.html">stun_tid</a> &amp;&#160;</td>
          <td class="paramname"><em>tid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const ioa_addr &amp;&#160;</td>
          <td class="paramname"><em>relayed_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const ioa_addr &amp;&#160;</td>
          <td class="paramname"><em>reflexive_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32bits&#160;</td>
          <td class="paramname"><em>lifetime</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>error_code</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u08bits *&#160;</td>
          <td class="paramname"><em>reason</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u64bits&#160;</td>
          <td class="paramname"><em>reservation_token</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Construct allocate response </p>

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l00979">979</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">                                                                      {

                <a class="code" href="ns__turn__msg_8h.html#aee82ab41df25d90b52bc4da2ac4520b1">stun_set_allocate_response_str</a>(<a class="code" href="classturn_1_1StunMsg.html#a0222f924d9fc1b9b268ba87c459dd7fd">_buffer</a>, &amp;<a class="code" href="classturn_1_1StunMsg.html#aa3c270c8abbdd22abe101907248754a9">_sz</a>, &amp;tid,
                                                   &amp;relayed_addr,
                                                   &amp;reflexive_addr,
                                                   lifetime, error_code, reason,
                                                   reservation_token);
        }
</pre></div>
</div>
</div>
<a class="anchor" id="a43503b954af564da59f9777c7527bb33"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classturn_1_1StunMsgResponse.html#a43503b954af564da59f9777c7527bb33">turn::StunMsgResponse::constructBindingResponse</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structstun__tid.html">stun_tid</a> &amp;&#160;</td>
          <td class="paramname"><em>tid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const ioa_addr &amp;&#160;</td>
          <td class="paramname"><em>reflexive_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>error_code</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u08bits *&#160;</td>
          <td class="paramname"><em>reason</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Construct binding response </p>

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l00963">963</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">                                                       {

                <a class="code" href="ns__turn__msg_8h.html#a5448e5280f0267a90b1639457f8b4873">stun_set_binding_response_str</a>(<a class="code" href="classturn_1_1StunMsg.html#a0222f924d9fc1b9b268ba87c459dd7fd">_buffer</a>, &amp;<a class="code" href="classturn_1_1StunMsg.html#aa3c270c8abbdd22abe101907248754a9">_sz</a>, &amp;tid,
                                        &amp;reflexive_addr, error_code,
                                        reason);
        }
</pre></div>
</div>
</div>
<a class="anchor" id="ad75a2b4892d6ddae86da0fb4d0aebbba"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void <a class="el" href="classturn_1_1StunMsgResponse.html#ad75a2b4892d6ddae86da0fb4d0aebbba">turn::StunMsgResponse::constructBuffer</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline, protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Implements <a class="el" href="classturn_1_1StunMsg.html#a15530c575e485a35f4d87ba7e117d195">turn::StunMsg</a>.</p>

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l01000">1000</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">                                       {
                <span class="keywordflow">if</span>(_err) {
                        <a class="code" href="ns__turn__msg_8h.html#ad8201c3c337098ca6ed1658d1896d59c">stun_init_error_response_str</a>(_method, <a class="code" href="classturn_1_1StunMsg.html#a0222f924d9fc1b9b268ba87c459dd7fd">_buffer</a>, &amp;<a class="code" href="classturn_1_1StunMsg.html#aa3c270c8abbdd22abe101907248754a9">_sz</a>, _err, (u08bits*)_reason.c_str(), &amp;_tid);
                } <span class="keywordflow">else</span> {
                        <a class="code" href="ns__turn__msg_8h.html#a61639b20b4a36d89230e93d91784dc50">stun_init_success_response_str</a>(_method, <a class="code" href="classturn_1_1StunMsg.html#a0222f924d9fc1b9b268ba87c459dd7fd">_buffer</a>, &amp;<a class="code" href="classturn_1_1StunMsg.html#aa3c270c8abbdd22abe101907248754a9">_sz</a>, &amp;_tid);
                }
                <a class="code" href="classturn_1_1StunMsg.html#ac00be2fea5b4ab929ea6078871ec33d8">_constructed</a> = <span class="keyword">true</span>;
        }
</pre></div>
</div>
</div>
<a class="anchor" id="ae64da83f5eec8c6b762710decbf21211"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classturn_1_1StunMsgResponse.html#ae64da83f5eec8c6b762710decbf21211">turn::StunMsgResponse::constructChannelBindResponse</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structstun__tid.html">stun_tid</a> &amp;&#160;</td>
          <td class="paramname"><em>tid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>error_code</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u08bits *&#160;</td>
          <td class="paramname"><em>reason</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Construct channel bind response </p>

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l00995">995</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">                                                                                                {
                <a class="code" href="ns__turn__msg_8h.html#a2d504956fe26d4e78e3e834f9d3d6688">stun_set_channel_bind_response_str</a>(<a class="code" href="classturn_1_1StunMsg.html#a0222f924d9fc1b9b268ba87c459dd7fd">_buffer</a>, &amp;<a class="code" href="classturn_1_1StunMsg.html#aa3c270c8abbdd22abe101907248754a9">_sz</a>, &amp;tid, error_code, reason);
        }
</pre></div>
</div>
</div>
<a class="anchor" id="a015b48d56d20d26577fcc8327a24b8fb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classturn_1_1StunMsgResponse.html#a015b48d56d20d26577fcc8327a24b8fb">turn::StunMsgResponse::getError</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Get error code </p>

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l00889">889</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">                             {
                <span class="keywordflow">return</span> _err;
        }
</pre></div>
</div>
</div>
<a class="anchor" id="ace411fb3e6be8571289b7bfa65289469"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16bits <a class="el" href="classturn_1_1StunMsgResponse.html#ace411fb3e6be8571289b7bfa65289469">turn::StunMsgResponse::getMethod</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l00878">878</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">                                  {
                <span class="keywordflow">return</span> _method;
        }
</pre></div>
</div>
</div>
<a class="anchor" id="ad6f25135216cbb232351063a41e0169a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string <a class="el" href="classturn_1_1StunMsgResponse.html#ad6f25135216cbb232351063a41e0169a">turn::StunMsgResponse::getReason</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Get error message </p>

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l00903">903</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">                                    {
                <span class="keywordflow">return</span> _reason;
        }
</pre></div>
</div>
</div>
<a class="anchor" id="aa7510a0d7f94b89d479fa128bf5bb66a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structstun__tid.html">stun_tid</a> <a class="el" href="classturn_1_1StunMsgResponse.html#aa7510a0d7f94b89d479fa128bf5bb66a">turn::StunMsgResponse::getTid</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>  throw (<a class="el" href="classturn_1_1WrongStunBufferFormatException.html">WrongStunBufferFormatException</a>)<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Get transaction ID </p>

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l00924">924</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">                                                                {
                <span class="keywordflow">return</span> _tid;
        }
</pre></div>
</div>
</div>
<a class="anchor" id="afce6f0043e1bdfca9ebe1c8b9114486e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classturn_1_1StunMsgResponse.html#afce6f0043e1bdfca9ebe1c8b9114486e">turn::StunMsgResponse::isBindingResponse</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l00972">972</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">                                       {
                <span class="keywordflow">return</span> <a class="code" href="ns__turn__msg_8h.html#a396d7367745ba09aab0b2ae55970f253">stun_is_binding_response_str</a>(<a class="code" href="classturn_1_1StunMsg.html#a0222f924d9fc1b9b268ba87c459dd7fd">_buffer</a>,<a class="code" href="classturn_1_1StunMsg.html#aa3c270c8abbdd22abe101907248754a9">_sz</a>);
        }
</pre></div>
</div>
</div>
<a class="anchor" id="aa13107eff5faec24cb4415f83c4183d9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classturn_1_1StunMsgResponse.html#aa13107eff5faec24cb4415f83c4183d9">turn::StunMsgResponse::isChallenge</a> </td>
          <td>(</td>
          <td class="paramtype">std::string &amp;&#160;</td>
          <td class="paramname"><em>realm</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::string &amp;&#160;</td>
          <td class="paramname"><em>nonce</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Check if this is a challenge response, and return realm and nonce </p>

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l00931">931</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">                                                                   {
                <span class="keywordtype">bool</span> ret = <span class="keyword">false</span>;
                <span class="keywordflow">if</span>(<a class="code" href="classturn_1_1StunMsg.html#ac00be2fea5b4ab929ea6078871ec33d8">_constructed</a>) {
                        <span class="keywordtype">int</span> err_code;
                        u08bits err_msg[1025];
                        <span class="keywordtype">size_t</span> err_msg_size=<span class="keyword">sizeof</span>(err_msg);
                        u08bits srealm[0xFFFF];
                        u08bits snonce[0xFFFF];
                        ret = <a class="code" href="ns__turn__msg_8h.html#a0fd8b30d2c2684c12355a1f416d0be71">stun_is_challenge_response_str</a>(<a class="code" href="classturn_1_1StunMsg.html#a0222f924d9fc1b9b268ba87c459dd7fd">_buffer</a>, <a class="code" href="classturn_1_1StunMsg.html#aa3c270c8abbdd22abe101907248754a9">_sz</a>, &amp;err_code, err_msg, err_msg_size, srealm, snonce);
                        <span class="keywordflow">if</span>(ret) {
                                realm = (<span class="keywordtype">char</span>*)srealm;
                                nonce = (<span class="keywordtype">char</span>*)snonce;
                        }
                }
                <span class="keywordflow">return</span> ret;
        }
</pre></div>
</div>
</div>
<a class="anchor" id="afb1272d9a7ef47752506fcdd53033843"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classturn_1_1StunMsgResponse.html#aa13107eff5faec24cb4415f83c4183d9">turn::StunMsgResponse::isChallenge</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l00948">948</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">                                 {
                std::string realm, nonce;
                <span class="keywordflow">return</span> <a class="code" href="classturn_1_1StunMsgResponse.html#afb1272d9a7ef47752506fcdd53033843">isChallenge</a>(realm, nonce);
        }
</pre></div>
</div>
</div>
<a class="anchor" id="a08663fcaf87fa75784f1be1f6c15b5f6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classturn_1_1StunMsgResponse.html#a08663fcaf87fa75784f1be1f6c15b5f6">turn::StunMsgResponse::isSuccess</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Check if this is a success response </p>

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l00956">956</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">                               {
                <span class="keywordflow">return</span> (_err == 0);
        }
</pre></div>
</div>
</div>
<a class="anchor" id="a50b8e415e84f0902c853fb3b0e816229"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classturn_1_1StunMsgResponse.html#a50b8e415e84f0902c853fb3b0e816229">turn::StunMsgResponse::setError</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>err</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Set error code </p>

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l00896">896</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">                               {
                _err = err;
        }
</pre></div>
</div>
</div>
<a class="anchor" id="a3402756dc96c4c762d9ee4a2354d2c37"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classturn_1_1StunMsgResponse.html#a3402756dc96c4c762d9ee4a2354d2c37">turn::StunMsgResponse::setMethod</a> </td>
          <td>(</td>
          <td class="paramtype">u16bits&#160;</td>
          <td class="paramname"><em>method</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l00882">882</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">                                       {
                _method = method;
        }
</pre></div>
</div>
</div>
<a class="anchor" id="a1df5a68abae6cd68c05e1b71d47f7e39"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classturn_1_1StunMsgResponse.html#a1df5a68abae6cd68c05e1b71d47f7e39">turn::StunMsgResponse::setReason</a> </td>
          <td>(</td>
          <td class="paramtype">std::string&#160;</td>
          <td class="paramname"><em>reason</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Set error message </p>

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l00910">910</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">                                         {
                _reason = reason;
        }
</pre></div>
</div>
</div>
<a class="anchor" id="abe1a0fb7b3753d0ced2a47f5052969c6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classturn_1_1StunMsgResponse.html#abe1a0fb7b3753d0ced2a47f5052969c6">turn::StunMsgResponse::setTid</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structstun__tid.html">stun_tid</a> &amp;&#160;</td>
          <td class="paramname"><em>tid</em></td><td>)</td>
          <td>  throw (<a class="el" href="classturn_1_1WrongStunBufferFormatException.html">WrongStunBufferFormatException</a>)<code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Set transaction ID </p>

<p>Reimplemented from <a class="el" href="classturn_1_1StunMsg.html#afd4f7f0ed495aa38cb005742cbac1991">turn::StunMsg</a>.</p>

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l00917">917</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">                                                                         {
                _tid = tid;
        }
</pre></div>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>src/client++/<a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a></li>
</ul>
</div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated on Tue Jan 22 2013 14:23:55 for TURN Server by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.0
</small></address>

</body>
</html>
